home *** CD-ROM | disk | FTP | other *** search
- /* -> h.ckucmd
- */
-
- /* C K U C M D . H -- Header file for Unix cmd package */
-
- /*
- Author: Frank da Cruz (SY.FDC@CU20B),
- Columbia University Center for Computing Activities, January 1985.
- Copyright (C) 1985, Trustees of Columbia University in the City of New York.
- Permission is granted to any individual or institution to use, copy, or
- redistribute this software so long as it is not sold for profit, provided this
- copyright notice is retained.
- */
-
- /* Special getchars... */
-
- #ifdef vax11c
- #define getchar() vms_getchar()
- #endif
-
- #ifdef aegis
- #define getchar() coninc(0)
- #endif
-
- /* Sizes of things */
-
- #define HLPLW 78 /* Width of ?-help line */
- #define HLPCW 19 /* Width of ?-help column */
- #define CMDBL 200 /* Command buffer length */
- #define HLPBL 100 /* Help string buffer length */
- #define ATMBL 100 /* Command atom buffer length*/
-
- /* Special characters */
-
- #ifndef NUL
- #define NUL '\0' /* Null */
- #endif
- #define HT '\t' /* Horizontal Tab */
- #define NL '\n' /* Newline */
- #ifndef CR
- #define CR '\r'
- #endif
- #define FF 0014 /* Formfeed (^L) */
- #define RDIS 0022 /* Redisplay (^R) */
- #define LDEL 0025 /* Delete line (^U) */
- #define WDEL 0027 /* Delete word (^W) */
- #define ESC 0033 /* Escape */
- #define RUB 0177 /* Rubout */
-
- #ifndef BEL
- #define BEL 0007 /* Bell */
- #endif
-
- #ifndef BS
- #define BS 0010 /* Backspace */
- #endif
-
- #ifndef SP
- #define SP 0040 /* Space */
- #endif
-
- /* Keyword table flags */
-
- #define CM_INV 1 /* Invisible keyword */
-
- /* Keyword Table Template */
-
- struct keytab { /* Keyword table */
- char *kwd; /* Pointer to keyword string */
- int val; /* Associated value */
- int flgs; /* Flags (as defined above) */
- };
-
- #ifdef ANSI
-
- /* Set prompt (extern int cmprom is prompt string, extern int cmerrp
- is error msg prefix) */
- extern void cmsetp( char * );
-
- extern void cmsavp( char *, int ); /* Save current prompt */
- extern void prompt( void ); /* Issue prompt */
-
- /* Clear the command buffer (before parsing a new command) */
- extern void cmini( int );
-
- /* Reset command buffer pointers (before reparsing) */
- extern void cmres( void );
-
- extern int cmkey( struct keytab[], int, char *, char * ); /* Parse a keyword */
- extern int cmnum( char *, char *, int, int * ); /* Parse a number */
-
- /* Parse an input file name */
- extern int cmifi( char *, char *, char **, int * );
-
- extern int cmofi( char *, char *, char ** ); /* Parse an output file name */
-
- extern int cmfld( char *, char *, char ** ); /* Parse an arbitrary field */
- extern int cmtxt( char *, char *, char ** ); /* Parse a text string */
- extern int cmcfm( void ); /* Parse command confirmation (end of line) */
- extern void stripq( char * ); /* Strip out backslash quotes from a string. */
- extern int chkwld( char * ); /* Check for wildcards '*' or '?' */
-
- extern void clrhlp( void ); /* Init/Clear the help line buffer */
- extern void addhlp( char * ); /* Add a string to the help buffer */
- extern void dmphlp( void ); /* Dump the help line buffer */
-
- extern int digits( char * ); /* Verify that all chars are digits */
- extern int getwd( void ); /* Get a word from the input stream */
-
- extern int setatm( char * ); /* Deposit a string in the atom buffer */
- extern int addbuf( char * ); /* Add a string to the command buffer */
-
- /* Lookup the string in the given array of strings */
- extern int lookup( struct keytab[], char *, int, int * );
-
- extern int test( int, int ); /* Bit test */
-
- extern int lower( char * ); /* Lower case a string */
- #endif
-